*===============================================================================
* Project title		Savings Accounts to Borrow Less	
* PIs			Felipe Kast, Dina Pomeranz 
* File name		5f_hetero_savings.do
*-------------------------------------------------------------------------------
* Description		Creates savings heterogeneity table 
* Outputs		Table A25 
* Spaces per tab 	8 
*===============================================================================

*===============================================================================
*TOC
*1)	Prepare data for analysis
*2)	Tables
*2.1)	Calculates table content 
*2.2)	Writes table
*===============================================================================

*===============================================================================
* Section 1 - Prepare data for analysis
*===============================================================================

clear all
global path "~/file_server/project_savings/2_shared/impact/do/November2019"	// Path to processed data
global results "$path/results"		
cd "$results"									// Change to directory to store results
set more off
set trace off
*Loading processed data
	use $path/datasets/impactDatabase.dta, clear

*===============================================================================
* Section 2 - Tables 
*===============================================================================
* Section 2.1 - Calculates table content 
*-------------------------------------------------------------------------------

	eststo clear
	
// Calculates content for Panels C-F	
	local i = 12
	
	foreach y in w5_allSavingsAd /*A7 A8 A9*/ w1_allSavingsAd /*A10 A11 A12*/ ///
	allSavingsAd /*A13 A14 A15*/ IHSallSavingsAd /*A16 A17 A18*/ {
	
	local i = `i' + 1 //updates counter
	local j = 1 //tracks column number 
	
	reg d.`y' if inSample == 1 // mark subjects nonmissing in both periods
	egen t1 = max(e(sample)), by(idBaseSurvey)
		
		*Col 1 regression. 			
			reghdfe `y' c.accountAccess#c.post post if t1 == 1,	 ///
			abs(idBaseSurvey) vce(cluster groupId)
			
			gen `y'_s`j' = e(sample) //marks observations used in sample for regression
			
			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post =      "No"
			estadd local hasacc_post =      "No"
                        estadd local soctaxed_post =    "No"
                        estadd local conflict_post =    "No"
                        estadd local ecoshock_post =    "No"
			eststo A`i'
		
		local i = `i' + 1 //updates counter
		local j = `j' + 1 //updates col number
			
		*Col 2 regression. 
			reghdfe `y' c.accountAccess#c.post#c.regretsNotSaving	///
			c.post#c.regretsNotSaving c.accountAccess#c.post post 	///
			if t1 == 1, abs(idBaseSurvey)				/// 
			vce(cluster groupId) 
			
			gen `y'_s`j' = e(sample) //marks observations used in sample for regression
					
			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"Yes"
			estadd local hasacc_post = 	"No"
			estadd local soctaxed_post = 	"No"
                        estadd local conflict_post = 	"No"
                        estadd local ecoshock_post =    "No"
			eststo A`i'
		
		local i = `i' + 1 //updates counter
		local j = `j' + 1 //updates col number 

		*Col 3 regression. 
			reghdfe `y' c.accountAccess#c.post#c.hasPrevAccount	///
			c.post#c.hasPrevAccount c.accountAccess#c.post post 	///
			if t1 == 1, abs(idBaseSurvey) 				///
			vce(cluster groupId) 
			
			gen `y'_s`j' = e(sample) //marks observations used in sample for regression
					
			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"No"
			estadd local hasacc_post = 	"Yes"
			estadd local soctaxed_post =    "No"
                        estadd local conflict_post =    "No"
                        estadd local ecoshock_post =    "No"
			eststo A`i'
			
		local i = `i' + 1 //updates counter
		local j = `j' + 1 //updates col number
			
                *Col 4 regression. 
			reghdfe `y' c.accountAccess#c.post#c.sociallyTaxed	///
			c.post#c.sociallyTaxed c.accountAccess#c.post post 	///
			if t1 == 1, abs(idBaseSurvey) 				///
			vce(cluster groupId) 
			
			gen `y'_s`j' = e(sample) //marks observations used in sample for regression
					
			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"No"
			estadd local hasacc_post = 	"No"
			estadd local soctaxed_post =    "Yes"
                        estadd local conflict_post =    "No"
                        estadd local ecoshock_post =    "No"
			eststo A`i'
			
		local i = `i' + 1 //updates counter
		local j = `j' + 1 //updates col number

                 *Col 5 regression. 
			reghdfe `y' c.accountAccess#c.post#c.conflictsMoney	///
			c.post#c.conflictsMoney c.accountAccess#c.post post 	///
			if t1 == 1, abs(idBaseSurvey) 				///
			vce(cluster groupId) 
			
			gen `y'_s`j' = e(sample) //marks observations used in sample for regression
					
			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"No"
			estadd local hasacc_post = 	"No"
			estadd local soctaxed_post =    "No"
                        estadd local conflict_post =    "Yes"
                        estadd local ecoshock_post =    "No"
			eststo A`i'
			
		local i = `i' + 1 //updates counter
		local j = `j' + 1 //updates col number

                *Col 6 regression. 
			reghdfe `y' c.accountAccess#c.post#c.economicShock2009	///
			c.post#c.economicShock2009 c.accountAccess#c.post post 	///
			if t1 == 1, abs(idBaseSurvey) 				///
			vce(cluster groupId) 
			
			gen `y'_s`j' = e(sample) //marks observations used in sample for regression
					
			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"No"
			estadd local hasacc_post = 	"No"
			estadd local soctaxed_post =    "No"
                        estadd local conflict_post =    "No"
                        estadd local ecoshock_post =    "Yes"
			eststo A`i'


		drop t1	
		di in red "`i'"
	}

// Variables to add as condition in regression for panels A and B 
	foreach x in 1 2 3 4 5 6 {
	gen in_s`x' = 1 if w5_allSavingsAd_s`x' == 1 & w1_allSavingsAd_s`x' == 1 	///
	& allSavingsAd_s`x' == 1 & IHSallSavingsAd_s`x' == 1
	}
	
	
// Calculates content for Panels A and B	
	local i = 0
	
	foreach y in PrallSavingsAd /*A1-6*/ savingsCatAd /*A7-12*/ ///
	{
	
	local i = `i' + 1 //updates counter
	local j = 1 //tracks column number 
	
	reg d.`y' if inSample == 1 // mark subjects nonmissing in both periods
	egen t1 = max(e(sample)), by(idBaseSurvey)
		
		*Col 1 regression. 			
			reghdfe `y' c.accountAccess#c.post post if t1 == 1 & in_s`j' == 1,	 ///
			abs(idBaseSurvey) vce(cluster groupId)
			
			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post =      "No"
			estadd local hasacc_post =      "No"
                        estadd local soctaxed_post =    "No"
                        estadd local conflict_post =    "No"
                        estadd local ecoshock_post =    "No"
			eststo A`i'
		
		local i = `i' + 1 //updates counter
		local j = `j' + 1 //updates col number
			
		*Col 2 regression. 
			reghdfe `y' c.accountAccess#c.post#c.regretsNotSaving	///
			c.post#c.regretsNotSaving c.accountAccess#c.post post 	///
			if t1 == 1 & in_s`j' == 1, abs(idBaseSurvey)		/// 
			vce(cluster groupId) 
					
			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"Yes"
			estadd local hasacc_post = 	"No"
			estadd local soctaxed_post = 	"No"
                        estadd local conflict_post = 	"No"
                        estadd local ecoshock_post =    "No"
			eststo A`i'
		
		local i = `i' + 1 //updates counter
		local j = `j' + 1 //updates col number 

		*Col 3 regression. 
			reghdfe `y' c.accountAccess#c.post#c.hasPrevAccount	///
			c.post#c.hasPrevAccount c.accountAccess#c.post post 	///
			if t1 == 1 & in_s`j' == 1, abs(idBaseSurvey) 		///
			vce(cluster groupId) 
					
			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"No"
			estadd local hasacc_post = 	"Yes"
			estadd local soctaxed_post =    "No"
                        estadd local conflict_post =    "No"
                        estadd local ecoshock_post =    "No"
			eststo A`i'
			
		local i = `i' + 1 //updates counter
		local j = `j' + 1 //updates col number
			
                *Col 4 regression. 
			reghdfe `y' c.accountAccess#c.post#c.sociallyTaxed	///
			c.post#c.sociallyTaxed c.accountAccess#c.post post 	///
			if t1 == 1 & in_s`j' == 1, abs(idBaseSurvey) 		///
			vce(cluster groupId) 
					
			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"No"
			estadd local hasacc_post = 	"No"
			estadd local soctaxed_post =    "Yes"
                        estadd local conflict_post =    "No"
                        estadd local ecoshock_post =    "No"
			eststo A`i'
			
		local i = `i' + 1 //updates counter
		local j = `j' + 1 //updates col number

                 *Col 5 regression. 
			reghdfe `y' c.accountAccess#c.post#c.conflictsMoney	///
			c.post#c.conflictsMoney c.accountAccess#c.post post 	///
			if t1 == 1 & in_s`j' == 1, abs(idBaseSurvey) 		///
			vce(cluster groupId) 
					
			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"No"
			estadd local hasacc_post = 	"No"
			estadd local soctaxed_post =    "No"
                        estadd local conflict_post =    "Yes"
                        estadd local ecoshock_post =    "No"
			eststo A`i'
			
		local i = `i' + 1 //updates counter
		local j = `j' + 1 //updates col number

                *Col 6 regression. 
			reghdfe `y' c.accountAccess#c.post#c.economicShock2009	///
			c.post#c.economicShock2009 c.accountAccess#c.post post 	///
			if t1 == 1 & in_s`j' == 1, abs(idBaseSurvey) 		///
			vce(cluster groupId) 
					
			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"No"
			estadd local hasacc_post = 	"No"
			estadd local soctaxed_post =    "No"
                        estadd local conflict_post =    "No"
                        estadd local ecoshock_post =    "Yes"
			eststo A`i'


		drop t1	
		di in red "`i'"
	}
	
//Col 7 8 9 regressions below:
// Panels C-F

	local i = 6
	
	foreach y in w5_allSavingsAd w5_netSavingsAd w5_changeTotalWealthAd 		/*B7 B8 B9*/		///
			w1_allSavingsAd w1_netSavingsAd w1_changeTotalWealthAd		/*B10 B11 B12*/ 	///
			allSavingsAd netSavingsAd changeTotalWealthAd			/*B13 B14 B15*/ 	///
			IHSallSavingsAd IHSnetSavingsAd IHSchangeTotalWealthAd 		/*B16 B17 B18*/  {
				
			local i = `i' + 1
			reg d.`y' if inSample == 1 //trick to mark subjects nonmissing in both periods
			egen t1 = max(e(sample)), by(idBaseSurvey)		
			
			reghdfe `y' c.accountAccess#c.post#c.hasPrevAccount 	///
			c.accountAccess#c.post#c.regretsNotSaving 		///
			c.accountAccess#c.post#c.sociallyTaxed 			///
			c.accountAccess#c.post#c.conflictsMoney 		///
			c.accountAccess#c.post#c.economicShock2009 		///
			c.post#c.hasPrevAccount c.post#c.regretsNotSaving 	///
			c.post#c.sociallyTaxed c.post#c.conflictsMoney 		///
			c.post#c.economicShock2009  				///
			c.accountAccess#c.post post if t1 == 1, abs(idBaseSurvey ) ///
			vce(cluster groupId) 
			
			gen `y'_s = e(sample) //marks observations used in the regression 

			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"Yes"
			estadd local hasacc_post = 	"Yes"
			estadd local soctaxed_post =    "Yes"
                        estadd local conflict_post =    "Yes"
                        estadd local ecoshock_post =    "Yes"
			eststo B`i'
			
		drop t1
		di in red "`i'"

	}
	
// Variables to add as condition in regression for panels A and B 
	
	gen PrallSavingsAd_s = w5_allSavingsAd_s
	gen savingsCatAd_s = w1_allSavingsAd 
	gen PrnetSavingsAd_s = w5_netSavingsAd_s
	gen PrchangeTotalWealthAd_s = w5_changeTotalWealthAd_s
	
// Panel A & B 
	local i = 0
	
	foreach y in PrallSavingsAd PrnetSavingsAd PrchangeTotalWealthAd /*B1 B2 B3*/ 	///
		/*savingsCatAd B4*/ {
				
			local i = `i' + 1
			reg d.`y' if inSample == 1 //trick to mark subjects nonmissing in both periods
			egen t1 = max(e(sample)), by(idBaseSurvey)		
			
			reghdfe `y' c.accountAccess#c.post#c.hasPrevAccount 	///
			c.accountAccess#c.post#c.regretsNotSaving 		///
			c.accountAccess#c.post#c.sociallyTaxed 			///
			c.accountAccess#c.post#c.conflictsMoney 		///
			c.accountAccess#c.post#c.economicShock2009 		///
			c.post#c.hasPrevAccount c.post#c.regretsNotSaving 	///
			c.post#c.sociallyTaxed c.post#c.conflictsMoney 		///
			c.post#c.economicShock2009  				///
			c.accountAccess#c.post post if t1 == 1 & `y'_s == 1, 	///
			abs(idBaseSurvey) ///
			vce(cluster groupId) 
			
		 

			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"Yes"
			estadd local hasacc_post = 	"Yes"
			estadd local soctaxed_post =    "Yes"
                        estadd local conflict_post =    "Yes"
                        estadd local ecoshock_post =    "Yes"
			eststo B`i'
			
		drop t1
		di in red "`i'"

	}
	
	local i = 4
	foreach y in savingsCatAd /*B4*/ {
				
			*local i = `i' + 1
			reg d.`y' if inSample == 1 //trick to mark subjects nonmissing in both periods
			egen t1 = max(e(sample)), by(idBaseSurvey)		
			
			reghdfe `y' c.accountAccess#c.post#c.hasPrevAccount 	///
			c.accountAccess#c.post#c.regretsNotSaving 		///
			c.accountAccess#c.post#c.sociallyTaxed 			///
			c.accountAccess#c.post#c.conflictsMoney 		///
			c.accountAccess#c.post#c.economicShock2009 		///
			c.post#c.hasPrevAccount c.post#c.regretsNotSaving 	///
			c.post#c.sociallyTaxed c.post#c.conflictsMoney 		///
			c.post#c.economicShock2009  				///
			c.accountAccess#c.post post if t1 == 1, 		///
			abs(idBaseSurvey) 					///
			vce(cluster groupId) 
			
		 

			//adding control mean		
			sum `y' if accountAccess == 0 & post == 1
			if (abs(`r(mean)') < 100) {
				estadd local control_mean = trim("`: display %12.3fc r(mean)'")
			} 
			else {
				estadd local control_mean = trim("`: display %12.0fc r(mean)'")
			}
			
			distinct idBaseSurvey  if e(sample)
			estadd scalar num_ind = r(ndistinct)
			estadd local ind_fixeff = 	"Yes"
			estadd local regret_post = 	"Yes"
			estadd local hasacc_post = 	"Yes"
			estadd local soctaxed_post =    "Yes"
                        estadd local conflict_post =    "Yes"
                        estadd local ecoshock_post =    "Yes"
			eststo B`i'
			
		drop t1
		di in red "`i'"

	}
                
*-------------------------------------------------------------------------------
* Section 2.2 - Writes table 
*-------------------------------------------------------------------------------

//probability	
	esttab A1 A2 A3 A4 A5 A6 B1 B2 B3 using tab_het_sav.tex, replace		///
	cells(b(star fmt(%12.3fc)) se(par fmt(%12.3fc))) label style(tex) nonumber	///
	stats( control_mean, fmt(%12.3fc %12.0fc %12.0fc)				///
	label("Control mean")) mlabels(,none) 						///	
	collabels(, none) eqlabels(, none)  						///
	keep(c.accountAccess#c.post#c.regretsNotSaving 					///
		c.accountAccess#c.post#c.hasPrevAccount 				///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		c.accountAccess#c.post#c.conflictsMoney 				///
		c.accountAccess#c.post#c.economicShock2009 				///
		c.accountAccess#c.post)							///
	order(c.accountAccess#c.post#c.regretsNotSaving 				///
		c.accountAccess#c.post#c.hasPrevAccount 				///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		c.accountAccess#c.post#c.conflictsMoney 				///
		c.accountAccess#c.post#c.economicShock2009 				///
		c.accountAccess#c.post)							///
	varlabels(c.accountAccess#c.post#c.regretsNotSaving 				///
		"Account $\times$ post $\times$ regret not saving more"         	///
		c.accountAccess#c.post#c.hasPrevAccount 				/// 
		"Account $\times$ post $\times$ already has bank account"	        ///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		"Account $\times$ post $\times$ socially taxed"		                ///
		c.accountAccess#c.post#c.conflictsMoney 				///
		"Account $\times$ post $\times$ household conflicts"			///
		c.accountAccess#c.post#c.economicShock2009 				///
		"Account $\times$ post $\times$ economic shock"                 	///	
		c.accountAccess#c.post "Account $\times$ post")				///
	starlevels(* 0.1 ** 0.05 *** 0.01) 						///
	prehead(\begin{tabular}{l*{@M}{c}} \hline \hline) 				 ///	
	posthead(	& (1) 		& (2) 		& (3) 		& (4) 		& (5) 		& (6) 		& (7) 		& (8) 		& (9) \\ 	///
			&  Total 	& Total 	& Total 	& Total 	& Total 	& Total 	& Total 	& Net total 	& Total \\ 	///
			&  financial 	& financial 	& financial 	& financial 	& financial 	& financial 	& financial 	& financial 	& financial  \\	///
			&  savings	& savings	& savings	& savings	& savings	& savings	& savings	& savings	& assets \\ 	///
		\hline \\ \multicolumn{@span}{l}{\textbf{Panel A:} Probability of Any Saving} \\ ) 		///
	prefoot( ) 												/// 
	postfoot( )


//winsor 5%
	esttab A13 A14 A15 A16 A17 A18 B7 B8 B9 using tab_het_sav.tex, append		///
	cells(b(star fmt(%12.0fc)) se(par fmt(%12.0fc))) label style(tex) nonumber	///
	stats( control_mean, fmt(%12.3fc %12.0fc %12.0fc)				///
	label("Control mean")) mlabels(,none) 						///	
	collabels(, none) eqlabels(, none)  						///
	keep(c.accountAccess#c.post#c.regretsNotSaving 					///
		c.accountAccess#c.post#c.hasPrevAccount 				///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		c.accountAccess#c.post#c.conflictsMoney 				///
		c.accountAccess#c.post#c.economicShock2009 				///
		c.accountAccess#c.post)							///
	order(c.accountAccess#c.post#c.regretsNotSaving 				///
		c.accountAccess#c.post#c.hasPrevAccount 				///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		c.accountAccess#c.post#c.conflictsMoney 				///
		c.accountAccess#c.post#c.economicShock2009 				///
		c.accountAccess#c.post)							///
	varlabels(c.accountAccess#c.post#c.regretsNotSaving 				///
		"Account $\times$ post $\times$ regret not saving more"         	///
		c.accountAccess#c.post#c.hasPrevAccount 				/// 
		"Account $\times$ post $\times$ already has bank account"	        ///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		"Account $\times$ post $\times$ socially taxed"		                ///
		c.accountAccess#c.post#c.conflictsMoney 				///
		"Account $\times$ post $\times$ household conflicts"			///
		c.accountAccess#c.post#c.economicShock2009 				///
		"Account $\times$ post $\times$ economic shock"                 	///	
		c.accountAccess#c.post "Account $\times$ post")				///		
	starlevels(* 0.1 ** 0.05 *** 0.01) 						///
	prehead( )									///
	posthead(\\ \multicolumn{@span}{l}{\textbf{Panel B:}  Amounts (Winsorized at the Top 5\%)} \\ ) ///
        prefoot( ) ///
	postfoot(  )

//winsor 1%
	esttab A19 A20 A21 A22 A23 A24 B10 B11 B12 using tab_het_sav.tex, append	///
	cells(b(star fmt(%12.0fc)) se(par fmt(%12.0fc))) label style(tex) nonumber	///
	stats( control_mean, fmt(%12.3fc %12.0fc %12.0fc)			        ///
	label("Control mean")) mlabels(,none) 		                                ///	
	collabels(, none) eqlabels(, none)  						///
	keep(c.accountAccess#c.post#c.regretsNotSaving 					///
		c.accountAccess#c.post#c.hasPrevAccount 				///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		c.accountAccess#c.post#c.conflictsMoney 				///
		c.accountAccess#c.post#c.economicShock2009 				///
		c.accountAccess#c.post)							///
	order(c.accountAccess#c.post#c.regretsNotSaving 				///
		c.accountAccess#c.post#c.hasPrevAccount 				///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		c.accountAccess#c.post#c.conflictsMoney 				///
		c.accountAccess#c.post#c.economicShock2009 				///
		c.accountAccess#c.post)							///
	varlabels(c.accountAccess#c.post#c.regretsNotSaving 				///
		"Account $\times$ post $\times$ regret not saving more"         	///
		c.accountAccess#c.post#c.hasPrevAccount 				/// 
		"Account $\times$ post $\times$ already has bank account"	        ///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		"Account $\times$ post $\times$ socially taxed"		                ///
		c.accountAccess#c.post#c.conflictsMoney 				///
		"Account $\times$ post $\times$ household conflicts"			///
		c.accountAccess#c.post#c.economicShock2009 				///
		"Account $\times$ post $\times$ economic shock"                 	///	
		c.accountAccess#c.post "Account $\times$ post")				///
	starlevels(* 0.1 ** 0.05 *** 0.01) 						///
	prehead( ) 				 ///	
	posthead( \\ \multicolumn{@span}{l}{\textbf{Panel C:} Amounts (Winsorized at the Top 1\%)} \\ ) 		///
	prefoot( ) 									///													
	postfoot( \\ \hline \hline \end{tabular} )

	
// non-winsorized
	esttab A25 A26 A27 A28 A29 A30 B13 B14 B15 using tab_het_sav2.tex, replace	///
	cells(b(star fmt(%12.0fc)) se(par fmt(%12.0fc))) label style(tex) nonumber	///
	stats( control_mean, fmt(%12.3fc %12.0fc %12.0fc)				///
	label("Control mean")) mlabels(,none) 						///	
	collabels(, none) eqlabels(, none)  						///
	keep(c.accountAccess#c.post#c.regretsNotSaving 					///
		c.accountAccess#c.post#c.hasPrevAccount 				///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		c.accountAccess#c.post#c.conflictsMoney 				///
		c.accountAccess#c.post#c.economicShock2009 				///
		c.accountAccess#c.post)							///
	order(c.accountAccess#c.post#c.regretsNotSaving 				///
		c.accountAccess#c.post#c.hasPrevAccount 				///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		c.accountAccess#c.post#c.conflictsMoney 				///
		c.accountAccess#c.post#c.economicShock2009 				///
		c.accountAccess#c.post)							///
	varlabels(c.accountAccess#c.post#c.regretsNotSaving 				///
		"Account $\times$ post $\times$ regret not saving more"         	///
		c.accountAccess#c.post#c.hasPrevAccount 				/// 
		"Account $\times$ post $\times$ already has bank account"	        ///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		"Account $\times$ post $\times$ socially taxed"		                ///
		c.accountAccess#c.post#c.conflictsMoney 				///
		"Account $\times$ post $\times$ household conflicts"			///
		c.accountAccess#c.post#c.economicShock2009 				///
		"Account $\times$ post $\times$ economic shock"                 	///	
		c.accountAccess#c.post "Account $\times$ post")				///
	starlevels(* 0.1 ** 0.05 *** 0.01) 						///
	prehead(\begin{tabular}{l*{@M}{c}} \hline \hline) 				 ///	
	posthead(	& (1) 		& (2) 		& (3) 		& (4) 		& (5) 		& (6) 		& (7) 		& (8) 		& (9) \\ 	///
			&  Total 	& Total 	& Total 	& Total 	& Total 	& Total 	& Total 	& Net total 	& Total \\ 	///
			&  financial 	& financial 	& financial 	& financial 	& financial 	& financial 	& financial 	& financial 	& financial  \\	///
			&  savings	& savings	& savings	& savings	& savings	& savings	& savings	& savings	& assets \\ 	///
		\hline \\ \multicolumn{@span}{l}{\textbf{Panel D:} Non-Winsorized Amounts} \\ ) 		///
	prefoot( )  postfoot( )	
	
// IHS
	esttab A31 A32 A33 A34 A35 A36 B16 B17 B18 using tab_het_sav2.tex, append 	///
	cells(b(star fmt(%12.3fc)) se(par fmt(%12.3fc))) label style(tex) nonumber	///
	stats( control_mean num_ind N regret_post hasacc_post soctaxed_post conflict_post ///
	ecoshock_post ind_fixeff, fmt(%12.3fc %12.0fc %12.0fc)				///
	label("Control mean" "\\ \hline Individuals" "Observations" 			///
		"Post $\times$ regret not saving more" 					///
		"Post $\times$ already has bank account" 				///
		"Post $\times$ socially taxed"						///
		"Post $\times$ household conflicts"					///
		"Post $\times$ economic shock"						///
		"Individual FE" )) mlabels(,none) 					///	
	collabels(, none) eqlabels(, none)  						///
	keep(c.accountAccess#c.post#c.regretsNotSaving 					///
		c.accountAccess#c.post#c.hasPrevAccount 				///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		c.accountAccess#c.post#c.conflictsMoney 				///
		c.accountAccess#c.post#c.economicShock2009 				///
		c.accountAccess#c.post)							///
	order(c.accountAccess#c.post#c.regretsNotSaving 				///
		c.accountAccess#c.post#c.hasPrevAccount 				///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		c.accountAccess#c.post#c.conflictsMoney 				///
		c.accountAccess#c.post#c.economicShock2009 				///
		c.accountAccess#c.post)							///
	varlabels(c.accountAccess#c.post#c.regretsNotSaving 				///
		"Account $\times$ post $\times$ regret not saving more"         	///
		c.accountAccess#c.post#c.hasPrevAccount 				/// 
		"Account $\times$ post $\times$ already has bank account"	        ///
		c.accountAccess#c.post#c.sociallyTaxed 					///
		"Account $\times$ post $\times$ socially taxed"		                ///
		c.accountAccess#c.post#c.conflictsMoney 				///
		"Account $\times$ post $\times$ household conflicts"			///
		c.accountAccess#c.post#c.economicShock2009 				///
		"Account $\times$ post $\times$ economic shock"                 	///	
		c.accountAccess#c.post "Account $\times$ post")				///
	prehead( ) ///
	posthead(\\ \multicolumn{@span}{l}{\textbf{Panel E:} Inverse Hyperbolic Sine of Amount} \\ ) ///
	prefoot( ) ///
	postfoot(\hline \hline \end{tabular} )	
	
	
